<?php
/**
 * Created by PhpStorm.
 * User: Yui
 * Date: 2017/5/24 0024
 * Time: 10:05
 */

namespace api\controllers;

use common\services\TimeReminderSve;
use Yii;
use common\controllers\ApiCommonCtrl;

class AutoController extends ApiCommonCtrl
{
    const KEY = 'adfihNMR4o3234gjODih22ger32w4434fdg';

    /**
     * 自动提醒方法
     */
    public function actionRemind()
    {
        $this->_checkKey();
        $TimeReminderSve = new TimeReminderSve();
        return $TimeReminderSve->doRemind();
    }

    /**
     * 验证
     */
    private function _checkKey()
    {
        $key = Yii::$app->request->get('key');
        if ($key !== self::KEY) {
            exit('┓(;´_｀)┏');
        }
    }
}